﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Home.Master" Inherits="System.Web.Mvc.ViewPage<VideoDetailViewModels>" %>
<%@ Import Namespace="ChoViet.Model" %>
<%@ Import Namespace="ChoViet.Lib.Paging" %>
<%@ Import Namespace="ChoViet.Site.Properties" %>
<%@ Import Namespace="ChoViet.Site.ViewModels" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%=Html.Encode(Model.Video!=null? Model.Video.Name: "Bất động sản TV") %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%if (Model.Video != null)
  { %>
<div class="clear"></div>
    <div class="breadcrumbs">
        <a href="/home">Trang chủ</a>
        <%if (Model.Video.VideoCategory != null)
          { %>
            
            <span></span><a href="/video/category/<%=Model.Video.VideoCategory.ID %>"><%=Model.Video.VideoCategory != null ? Html.Encode(Model.Video.VideoCategory.Name) : string.Empty%></a>
            <span></span><%=Model.Video.Name.Length > 60 ? Html.Encode(Model.Video.Name.Substring(0, 60)) + "..." : Html.Encode(Model.Video.Name)%>
        <%} %>
    </div>
<div class="line"></div>
<%} %>
<div id="detail-art">
    <h2><%=Html.Encode(Model.Video.Name)%></h2>
    <div class="content-detail-art-date">
        <%=Model.Video.AddDate.Value.ToString("HH:mm")%>&nbsp; | <%=Model.Video.AddDate.Value.ToString("dd/MM/yyyy")%>&nbsp;|&nbsp;<%=Html.Encode(Model.Video.Source) %>
    </div>
    <div class="summary-detail-art">
        <%=Html.Encode(Model.Video.Summary)%>           
    </div>
    <div class="content-detail-art" id="Div1" style="text-align:center">
        <% 
                string pathImage = "";
                string pathVideo = "";
                if (Model.Video.ImagePath != string.Empty)
                {
                    pathImage = ChoViet.Lib.Common.Utils.GenThumbnail(Model.Video.ID, 450, 350, Model.Video.ImagePath, Model.VideoImagePath, Model.VideoImageUrl);

                }
                else
                    pathImage = Model.VideoImageUrl + ChoViet.Lib.Common.Globals.DefaultLogo;
                pathVideo = Model.VideoFileUrl + Model.Video.ID + "_" + Model.Video.VideoPath;

                if (!string.IsNullOrEmpty(Model.Video.VideoPath))
                {
            %>
            <embed height="350" width="450" flashvars="file=<%=pathVideo%>&image=<%=pathImage%>&lightcolor=000000&frontcolor=000000"
                allowscriptaccess="always" allowfullscreen="true" quality="high" bgcolor="#FFFFFF"
                name="ply" id="ply" style="" src="/FlashPlayer/TSPlayer.swf" type="application/x-shockwave-flash" />
            <%} %>
            <%else if (Model.Video.Code != null && Model.Video.Code != string.Empty)
                { %>
                    <%=Model.Video.Code %>
            <%} %>
    </div>
    <div class="content-detail-art" id="content-art">
        <%=Model.Video.Description%>
    </div>
</div>
 <% Html.RenderAction("TagLasted", "Video", new { id = Model.Video.ID, title = "Tags" }); %>
<div class="clear">&nbsp;</div>
<%if (Model.Video != null)
  { %>
<% Html.RenderAction("LatestComments", new { id = Model.Video.ID, number = 20 }); %>
<% Html.RenderAction("Comment", new { id = Model.Video.ID }); %>
<%} %>
<div class="clear"></div>
<%if (Model.Video.Source != null && Model.Video.Source != string.Empty)
  {
      Html.RenderAction("OtherItems", "Video", new { id = Model.Video.ID, number = 10, source = Model.Video.Source, title = Model.Video.VideoCategory.Name + " cùng nguồn đăng tin", pubYN = 1, order = "ID", orderDir = "desc" });
  } %>

<%if (Model.Video.VideoProjectMaps.Count > 0)
  {
      Html.RenderAction("OtherItemsInInvestors", "Video", new { id = Model.Video.ID, number = 10, source = Model.Video.Source, title = "Video giới thiệu dự án cùng chủ đầu tư", pubYN = 1, order = "ID", orderDir = "desc" });
      Html.RenderAction("OtherItemsInCity", "Video", new { id = Model.Video.ID, number = 10, source = Model.Video.Source, title = "Video giới thiệu dự án cùng tỉnh thành phố", pubYN = 1, order = "ID", orderDir = "desc" });
      Html.RenderAction("OtherItemsInProjectCategory", "Video", new { id = Model.Video.ID, number = 10, source = Model.Video.Source, title = "Video giới thiệu dự án cùng chủng loại", pubYN = 1, order = "ID", orderDir = "desc" });

  } %>
  <%if (Model.Video.VideoCompanyMaps.Count > 0)
  {
      Html.RenderAction("OtherItemsInCompanyType", "Video", new { id = Model.Video.ID, number = 10, source = Model.Video.Source, title = "Video giới thiệu doanh nghiệp cùng ngành nghề", pubYN = 1, order = "ID", orderDir = "desc" });
      Html.RenderAction("OtherItemsInCompanyCity", "Video", new { id = Model.Video.ID, number = 10, source = Model.Video.Source, title = "Video giới thiệu doanh nghiệp cùng tỉnh thành phố", pubYN = 1, order = "ID", orderDir = "desc" });
  } %>
<% Html.RenderAction("OtherItems", "Video", new { id = Model.Video.ID, number = 10, source = string.Empty, title = Model.Video.VideoCategory.Name + " mới khác", pubYN = 1, order = "ID", orderDir = "desc" }); %>   

</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="RightContent" runat="server">
    <% Html.RenderAction("Lasted", "Video", new { catid = Model.Video.VideoCategory != null ? Model.Video.VideoCategory.ID : 0, number = 3, title = Model.Video.VideoCategory != null ? Model.Video.VideoCategory.Name : string.Empty }); %>
    <div class="clear"></div>
    <%--<% Html.RenderAction("Focus", "Article", new { number = 5, skip = 0, catid = ChoViet.Model.ConfigManager.GetArticle(), title = "Thị trường bất động sản", order = "ID", orderDir = "desc" }); %>--%>
    <div class="clear"></div>
    <% Html.RenderAction("Lasted", "Useful", new { number = 9 }); %>
    <div class="clear"></div>
    <% Html.RenderAction("Lasted", "Event", new { number = 3, catid =0 }); %>
    <div class="clear"></div>     
   <%--<% Html.RenderAction("Focus", "company", new { number = 5, skip = 0, catid = 55, title = "Tin doanh nghiệp", order = "ID", orderDir = "desc" }); %>--%>
    <div class="clear"></div>
</asp:Content>
